package com.bainuo.doctor.common.widget;

import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.PorterDuff;
import android.graphics.PorterDuffXfermode;
import android.graphics.Rect;
import android.support.annotation.Nullable;
import android.util.AttributeSet;
import android.util.TypedValue;
import android.widget.TextView;

import com.bainuo.doctor.common.constant.Constant;
import com.bainuo.doctor.common.util.DisplayUtil;

/**
 * Created by luwei on 2017/10/11.
 */

public class CustomTextView extends TextView {
    public CustomTextView(Context context, @Nullable AttributeSet attrs) {
        super(context, attrs);
        //设置修改字体大小
        setTextSize(TypedValue.COMPLEX_UNIT_PX,getTextSize() + DisplayUtil.dip2px(context,Constant.TEXT_SIZE) );
//        setTypeface(BaseApplication.getInstance().getTypeface());
    }

    public CustomTextView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
        setTextSize(TypedValue.COMPLEX_UNIT_PX,getTextSize() + DisplayUtil.dip2px(context,Constant.TEXT_SIZE) );
    }

    public CustomTextView(Context context) {
        super(context);
        setTextSize(TypedValue.COMPLEX_UNIT_PX,getTextSize() + DisplayUtil.dip2px(context,Constant.TEXT_SIZE) );
    }



    @Override
    public void onDrawForeground(Canvas canvas) {
        super.onDrawForeground(canvas);
    }

    @Override
    public void setTextSize(float size) {
        super.setTextSize(size);
    }
}
